package os.t1;

public class ProductThread extends Thread{
    private Resources resources;
    public ProductThread(Resources resources){
        this.resources=resources;
    }
    public void run() {
        while(true){
            try {
                resources.product();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
